// 找 a[i][j] 用最后一行和最后一列表示的系数关系
// ml:run = $bin < input
#include <iostream>
#include <map>

int const maxn = 500;
int a[maxn][maxn];
int n, m;

std::map<std::pair<int, int>, std::map<std::pair<int, int>, int>> all;

void dp(int x, int y)
{
    if (x == n || y == m) {
        all[{x, y}][{x, y}] = 1;
        return;
    }
    if (all.count({x, y})) return;
    dp(x + 1, y);
    for (auto i : all[{x + 1, y}]) all[{x, y}][i.first] -= i.second;
    dp(x, y + 1);
    for (auto i : all[{x, y + 1}]) all[{x, y}][i.first] -= i.second;
    dp(x + 1, y + 1);
    for (auto i : all[{x + 1, y + 1}]) all[{x, y}][i.first] -= i.second;
}

int main()
{
    std::ios_base::sync_with_stdio(false);
    std::cin >> n >> m;
    n = 4; m = 4;
    dp(1, 1);
    for (int x = 1; x < n; x++) {
        for (int y = 1; y < m; y++) {
            std::cout << x << ", " << y << "\n";
            for (auto i : all[{x, y}]) {
                if (i.second == 0) continue;
                std::cout << "(" << i.first.first << ", " << i.first.second << ") = " << i.second << "\n";
            }
        }
    }
}

